package service;

import bean.Employee;
import dao.EmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeService {

    @Autowired
    EmployeeMapper mapper;

    /**
     * 查询所有员工
     * @return
     */
    public List<Employee> getAllEmployees() {
        return mapper.selectByEmployeeWithDept(null);
    }

    /**
     * 添加员工*/
    public int addEmploy(Employee employee) {
        return mapper.insertSelective(employee);
    }
}